#ifndef DISPATCHER_H
#define DISPATCHER_H

#include "EventLoop.h"
#include "Channel.h"
#include "string"

using namespace std;
class EventLoop;
class Dispatcher
{
public:
    Dispatcher(EventLoop* evLoop);

    virtual ~Dispatcher();

    virtual int add();

    virtual int remove();

    virtual int modify();

    virtual int dispatch(int timeout = 2);

    inline void setChannel(Channel* channel) {
        m_channel = channel;
    }

protected:
    string m_name = string();
    Channel* m_channel;
    EventLoop* m_evLoop;
};

#endif // DISPATCHER_H
